/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package is.ru.domain;

/**
 *
 * @author davidhalldor
 */
public class Ingredient {

    private int id;
    private String name;
    private Double cost;
    private Double ammount;
    private String measure;
    private boolean purchased; 
    
    public Ingredient() {
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setCost(Double cost) {
        this.cost = cost;
    }

    public Double getCost() {
        return cost;
    }

    public Double getAmmount() {
        return ammount;
    }

    public void setAmmount(Double ammount) {
        this.ammount = ammount;
    }

    public void setMeasure(String measure) {
        this.measure = measure;
    }

    public String getMeasure() {
        return measure;
    }

    public boolean isPurchased() {
        return purchased;
    }

    public void setPurchased(boolean purchased) {
        this.purchased = purchased;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }
    
    public String getMeasureAndAmount(Double people) {
        String measureAndAmmount;
        Double ammount = this.ammount * people;
        measureAndAmmount = ammount.toString() + " " + this.measure;
        if (measureAndAmmount != null) {
            return measureAndAmmount;
        } else {
            return "";
        }
    }
}
